package com.example.test.service.Impl;
import com.example.test.entity.User;
import com.example.test.mapper.UserMapper;
import com.example.test.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserserviceImpl implements Userservice {
    @Autowired
    private UserMapper userMapper;

    @Override
    public boolean findByName(String username, String password) {
        boolean flag = false;
        flag = userMapper.findByName(username, password);
        return flag;
    }

    @Override
    public boolean InsertUser(String username, String password, Integer id) {
        boolean flag = userMapper.InsertUser(username, password, id);
        return flag;
    }

    @Override
    public int Insert(User user) {
        return 0;
    }

    @Override
    public List<User> getUser() {
        return userMapper.getUser();

    }
    public List<User> getUsername(String username, Integer id) {
        return userMapper.getUsername(username, id);
    }

    @Override
    public boolean deleteUser(String username) {
        return userMapper.deleteUser(username);
    }
}
